<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./echarts/echarts.min.js"></script>
</head>

<body>
    <!-- 必须带宽高的盒子才能渲染成功 -->
    <div id="main" style="width: 600px;height:400px;"></div>

    <script>
        // 初始化echarts
        const myChart = echarts.init(document.querySelector('#main'));

        // 指定图表的配置项和数据
        const option = {
            backgroundColor: '#080b30',
            title: {
                text: '单位：万',
                textStyle: {
                    align: 'center',
                    color: 'rgba(2, 145, 232)',
                    fontSize: 20,
                },
                top: '5%',
                left: '20',
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    lineStyle: {
                        color: {
                            type: 'linear',
                            x: 0,
                            y: 0,
                            x2: 0,
                            y2: 1,
                            colorStops: [{
                                offset: 0,
                                color: 'rgba(0, 255, 233,0)'
                            }, {
                                offset: 0.5,
                                color: 'rgba(255, 255, 255,1)',
                            }, {
                                offset: 1,
                                color: 'rgba(0, 255, 233,0)'
                            }],
                            global: false
                        }
                    },
                },
            },
            legend: {
                data: ["预期销售额", "实际销售额"]
            },
            grid: {
                top: '15%',
                left: '5%',
                right: '5%',
                bottom: '15%',
                containLabel: true
            },
            xAxis: [{
                type: 'category',
                axisLine: {
                    show: true
                },
                splitArea: {
                    // show: true,
                    color: '#f00',
                    lineStyle: {
                        color: '#f00'
                    },
                },
                axisLabel: {
                    color: '#fff'
                },
                splitLine: {
                    show: false
                },
                boundaryGap: false,
                data: ["1月", "2月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],

            }],

            yAxis: [{
                type: 'value',
                min: 0,
                // max: 140,
                splitNumber: 4,
                splitLine: {
                    show: true,
                    lineStyle: {
                        color: 'rgba(255,255,255,0.1)'
                    }
                },
                axisLine: {
                    show: false,
                },
                axisLabel: {
                    show: false,
                    margin: 20,
                    textStyle: {
                        color: '#d1e6eb',

                    },
                },
                axisTick: {
                    show: false,
                },
            }],
            series: [{
                name: '预期销售额',
                type: 'line',
                smooth: true, //是否平滑
                showAllSymbol: true,
                // symbol: 'image://./static/images/guang-circle.png',
                symbol: 'emptyCircle',
                symbolSize: 20,
                lineStyle: {
                    normal: {
                        color: "red",

                    },
                },
                itemStyle: {
                    color: "red",
                    borderColor: "#fff",
                    borderWidth: 3,

                },


                tooltip: {
                    show: false
                },

                data: [502.84, 205.97, 332.79, 281.55, 398.35, 214.02, 258, 369, 147, 546, 123, 145,]
            },
            {
                name: '实际销售额',
                type: 'line',
                smooth: true, //是否平滑
                showAllSymbol: true,

                symbol: 'emptyCircle',
                symbolSize: 20,
                lineStyle: {
                    // 线条颜色
                    normal: {
                        color: "rgba(2, 224, 225)",

                    },
                },
                itemStyle: {
                    color: "rgba(2, 224, 225",
                    borderColor: "#fff",
                    borderWidth: 3,

                },



                tooltip: {
                    show: false
                },

                data: [281.55, 398.35, 214.02, 179.55, 289.57, 356.14, 281.55, 398.35, 214.02, 258, 369,],
            },
            ]
        };
        // 使用刚指定的配置项和数据显示图表。
        // 渲染到页面
        myChart.setOption(option);
    </script>
</body>

</html>